Apparatus and system for managing a sensor network

ABSTRACT

A method for remotely managing a sensor network topology includes: receiving a device management DM command sent by a device management server, where the DM command acts on a preconstructed management object MO node and the MO node includes a node configured to discover a sensor network topology, a node configured to describe a sensor network topology, or a node configured to modify a sensor network topology; and managing a sensor network according to the DM command, where the management includes discovering the sensor network topology, describing the sensor network topology, or modifying the sensor network topology. By adopting the present invention, remote topology management of a sensor network successive to an M2M gateway can be implemented and the complexity for implementing the management is reduced.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.14/563,631, filed on Dec. 8, 2014, now allowed, which is a continuationof U.S. application Ser. No. 13/872,968, filed on Apr. 29, 2013, nowU.S. Pat. No. 8,908,562, which is a continuation of InternationalApplication No. PCT/CN2011/074608, filed on May 24, 2011, which claimspriority to Chinese Patent Application No. 201010527473.9, filed on Oct.27, 2010, all of which are hereby incorporated by reference in theirentireties.

FIELD

The present invention relates to the communications technologies, and inparticular, to a method for remotely managing a sensor network topologyand a gateway.

BACKGROUND

The machine-to-machine communications (Machine-to-MachineCommunications, M2M) is a type of networked application and service withmachine-to-machine intelligent interactions being the core. The M2Mcommunications implements data communications without human interventionby embedding wireless or wired communication modules and applicationprocessing logic in machines, so as to satisfy user's informatizationrequirements in the aspects such as detecting, directing anddispatching, and data collection and measurement. A conventional M2Msystem architecture includes M2M terminals, an M2M gateway, an M2Mservice platform, and an M2M application platform, where the M2Mterminals may be a sensor, a microcontroller, and the like. The M2Mterminals are connected to the M2M gateway by using the technology ofstub sensor network (for example, the ZigBee and the BlueTooth) andfurther connected to the M2M service platform through the M2M gatewayusing a remote access technology (for example, a 2G/3G wireless cellularnetwork). Moreover, all types of M2M application platform (for example,electric meter reading and intelligent traffic) acquire, through the M2Mservice platform, data collected by the M2M terminals, or remotelycontrol and manage the M2M terminals in a sensor network.

The management of a remote device is an important function of an M2Msystem, that is, the M2M application platform or an M2M service provideris required to perform daily management and maintenance of the M2Mterminals in the stub sensor network remotely through the M2M serviceplatform and the M2M gateway. Because the stub sensor network generallyperforms networking in a self-organized manner, sometimes, it isdifficult to predict a network topology and a working status of adevice. Therefore, an administrator needs to discover a topology toadjust the topology. The topology discovery is to find which devices arecontained in the sensor network and the communication connectionrelationships among the devices through a remote network topologymanagement function. The topology adjustment is to perform proper manualadjustment when necessary.

In the prior art, remote device management technologies based on a widearea network mainly include the device management (Device Management,DM) regulations defined by the Open Mobile Alliance (OMA). Thetechnology can implement remote management for the M2M gateway throughoperating management object (Management Object, MO) data on the M2Mgateway, but still does not support remote topology management for astub sensor network through the M2M gateway. In another aspect, in thefield of sensor networks, the ZigBee gateway device regulations define atechnology of remote network management based on an Internet protocol(Internet Protocol, IP) bearer. The technology can provide a simpleremote ZigBee network device and an operation method for servicediscovery rather than directly provide topology information of thesensor network and a topology adjustment method. The above function canonly be implemented by further combining other ZigBee managementcommands, where the operation method is complicated. Other sensornetwork protocols (for example, the BlueTooth) do not provide a methodfor remotely managing a topology through a gateway.

SUMMARY

An embodiment of the present invention provides a Machine to Machine(M2M) gateway. The M2M gateway includes a receiver, a processor and atransmitter. The receiver is configured to receive a device management(DM) command from a DM server, which connects to at least two sensordevices within a sensor network via the M2M gateway. The processor isconfigured to: based on the DM command, access a topology tree thatincludes two or more management object (MO) nodes, which describe asensor network topology including a connectional relationship betweenthe at least two sensor devices within the sensor network, and wherein afirst of the two or more MO nodes includes an identification and type ofthe sensor network and a second of the at least two or more MO nodesdescribes a characteristic of each of the at least two sensor devicesand a connectional relationship between them; based on addressinformation within the DM command, locate at least one of the two ormore MO nodes; and retrieve information from the located at least one ofthe two or more MO nodes. The transmitter is configured to send theretrieved information to the DM server.

Another embodiment of the present invention provides a network systemincluding a device management (DM) server and a Machine to Machine (M2M)gateway which is connected to the DM server and a plurality of sensordevices in a sensor network. The DM server is configured to send a DMcommand to the M2M gateway. The M2M gateway is configured: based on theDM command, access a topology tree that includes two or more managementobject (MO) nodes, which describe a sensor network topology including aconnectional relationship between the at least two sensor devices withinthe sensor network, and wherein a first of the two or more MO nodesincludes an identification and type of the sensor network and a secondof the at least two or more MO nodes describes a characteristic of eachof the at least two sensor devices and a connectional relationshipbetween them; based on address information within the DM command, locateat least one of the two or more MO nodes; retrieve information from thelocated at least one of the two or more MO nodes; and send the retrievedinformation to the DM server.

BRIEF DESCRIPTION OF THE DRAWINGS

To illustrate the technical solutions in the embodiments of the presentinvention or in the prior art more clearly, the following brieflydescribes the accompanying drawings required for describing theembodiments or the prior art. Apparently, the accompanying drawings inthe following description show some embodiments of the presentinvention, and persons of ordinary skill in the art can derive otherdrawings from these accompanying drawings without creative efforts.

FIG. 1 is a schematic flow chart of a method according to Embodiment 1of the present invention;

FIG. 2 is a tree-like MO structural model for implementing remotemanagement of a sensor network topology according to an embodiment ofthe present invention;

FIG. 3 is a schematic diagram of an MO child tree of service of a ZigBeedevice according to an embodiment of the present invention;

FIG. 4 is a schematic diagram of an MO child tree of service of aBlueTooth device according to an embodiment of the present invention;

FIG. 5A and FIG. 5B is a schematic flow chart of a method according toEmbodiment 2 of the present invention;

FIG. 6 is a schematic flow chart of a method according to Embodiment 3of the present invention;

FIG. 7A and FIG. 7B is a schematic flow chart of a method according toEmbodiment 4 of the present invention;

FIG. 8 is a schematic flow chart of a method according to Embodiment 5of the present invention;

FIG. 9 is a schematic flow chart of a method according to Embodiment 6of the present invention;

FIG. 10 is a schematic flow chart of a method according to Embodiment 7of the present invention;

FIG. 11A and FIG. 11B is a schematic flow chart of a method according toEmbodiment 8 of the present invention; and

FIG. 12 is a schematic structural diagram of a gateway according toEmbodiment 9 of the present invention.

DETAILED DESCRIPTION OF THE EMBODIMENTS

To make the objectives, technical solutions, and advantages of thepresent invention more comprehensible, the following clearly andcompletely describes the technical solutions according to theembodiments of the present invention with reference to the accompanyingdrawings in the embodiments of the present invention. Apparently, theembodiments in the following description are merely a part of ratherthan all the embodiments of the present invention. All other embodimentsobtained by persons of ordinary skill in the art based on theembodiments of the present invention without creative efforts shall fallwithin the protection scope of the present invention.

FIG. 1 is a schematic flow chart of a method according to Embodiment 1of the present invention. The method includes the following steps:

Step 11: A gateway receives a DM command sent by a device managementserver, where the DM command acts on a preconstructed MO node and the MOnode includes a node configured to discover a sensor network topology, anode configured to describe a sensor network topology, or a nodeconfigured to modify a sensor network topology.

The node configured to describe a sensor network topology includes atleast one of:

a first MO node configured to describe overall information of the sensornetwork, in which, for example, referring to the topology tree shown inFIG. 2, the first MO node includes at least one of: Topo/NetworkId andTopo/TopoTyp;

a second MO node configured to describe characteristic information ofeach sensor device and/or information of a topology connectionrelationship among the sensor devices, in which, for example, referringto the topology tree shown in FIG. 2, the second MO node includes atleast one of: Topo/DevList/<x>/DevId, Topo/DevList/<x>/Name,Topo/DevList/<x>/DevTyp, Topo/DevList/<x>/LocAddr, andTopo/DevList/<x>/Neighbors (of course, it can be understood that a childnode “Operations” under “Neighbors” is not included); and

a third MO node configured to describe information about a serviceprovided by each sensor device, in which, for example, referring to thetopology tree shown in FIG. 2, the third MO node includes the followingitem: Topo/DevList/<x>/Service (of course, it can be understood that thechild node “Operations” under “Neighbors” is not included).

The node configured to discover the sensor network topology includes:

a fourth MO node configured to discover the topology connectionrelationship among the sensor devices and/or the information about aservice provided by each sensor device, in which, for example, referringto the topology tree shown in FIG. 2, the fourth MO node includes atleast one of: Topo/Operations/DiscTopo andTopo/Operations/DiscTopoAndServices.

The node configured to modify a sensor network topology includes atleast one of:

a fifth MO node configured to modify the topology connectionrelationship among the sensor devices, in which, for example, referringto the topology tree shown in FIG. 2, the fifth MO node includes atleast one of: Topo/DevList/<x>/Operations andTopo/DevList/<x>/Neighbors/<x>/Operations; and

a sixth MO node configured to modify the information about a serviceprovided by the sensor devices, in which, for example, referring to thetopology tree shown in FIG. 2, the sixth MO node includes the followingitem: Topo/DevList/<x>/Services/<x>/Operations.

Furthermore, this embodiment may also include:

constructing a topology tree, where the topology tree is composed of aplurality of MO nodes.

The constructed topology tree is shown in FIG. 2. FIG. 2 is a tree-likeMO structural model for implementing remote management of a sensornetwork topology in the embodiment of the present invention, where eachblock indicates one MO node or its one child node in a management tree.For the sake of conciseness, FIG. 2 does not list information of allnodes in the management tree, but only lists the information of nodesclosely related to the embodiment of the present invention.

It should be noted that, different symbols may be marked after nodenames in the node blocks, which are as follows: “?” indicates that thenode may have 0 or 1 instance; “*” indicates that the node may have 0 ormore instances; no symbol indicates that the node may have 1, and only1, instance; and “+” indicates that the node may have 1 or moreinstances. When a node name is “<x>”, it indicates that the node namemay be assigned at will as long as no repetition occurs among theplurality of instances.

The meanings and usages of each MO node are introduced one by one in thefollowing:

The Topo node records all MO information for remotely managing a sensornetwork topology, the MO information generally includes: overallcharacteristic information and a management method of a sensor network,information and a management method of each sensor network device, andinformation and a management method of a topology relationship among thesensor network devices. The Topo node may be placed at a proper location(under a root node or other MO leaf nodes) in the management tree of thegateway according to requirements of specific implementation.Specifically, the Topo node includes the following child nodes:

1) NetworkID: used to describe information of an identifier of a sensornetwork managed by the gateway. For example, in the case of a ZigBeenetwork, the NetworkID corresponds to a 16-bit PANID parameter and/or a64-bit ExtendedPANID parameter; and in the case of a BlueTooth network,the NetworkID corresponds to a device identifier of a master device(Master) in the network. The information may be extracted from amanagement information base of the gateway device.

2) TopoTyp: used to describe a topology type of the sensor network,which may be a ring topology, star topology, tree topology, meshtopology, bus topology, hybrid topology, and the like. The informationmay be decided according to a specific technology sensor networkconnected to the gateway device (for example, a BlueTooth network uses astar structure and a ZigBee network uses a tree structure or meshstructure), or the information may be further extracted from themanagement information base of the gateway device.

3) Ext: used to extend other nodes to describe other topologycharacteristics of the sensor network managed by the gateway.

4) Operations: used to provide an overall operation method for thetopology management for the sensor network managed by the gateway. Thefollowing executable child nodes are further included:

41) DiscTopo: indicating that the gateway discovers and reportsinformation of the sensor network topology. The node may further includea child node:

411) Notification: where the value of the node may be TRUE or FALSE,used to indicate whether the gateway proactively notifies a remotedevice management server (M2M service platform) of a subsequent changestatus of the sensor network topology, and some filtering conditions(for example, the topology changes related to which device need to benotified, the frequency of the notification, and which device managementservers the notification need to be sent to) may be further included.

42) DiscTopoAndService: indicating that the gateway discovers andreports information of the sensor network topology, and discovers andreports service and application provided by each sensor network device.The node may further include the following child node:

421) Notification: where the value of the node may be TRUE or FALSE,used to indicate whether the gateway proactively notifies a remotedevice management server (M2M service platform) of the subsequent changestatus of the sensor network topology and change status of the serviceof the sensor device. And some filtering conditions (for example, thetopology and service changes related to which device require to benotified, the frequency of the notification, and which device managementservers the notification needs to be sent to) may be further included.

43) Ext: indicating that other topology management operation methods mayalso be extended for different sensor network technologies. For example,for a ZigBee network, a FormNetwork node and a StartRouter node may beextended, used to indicate that the gateway device acts as a coordinatorto reconstruct the ZigBee network and acts as a router to rejoin in thenetwork, respectively. Accordingly, their respective child nodes may befurther extended to store corresponding operation parameters.

5) DevList: used to describe information of a topology related to eachsensor network device managed by the gateway and a topology managementoperation method related to each sensor network device managed by thegateway, where the information of each sensor network device isrepresented by one <x> node under the DevList. Moreover, the <x> nodefurther includes the following child nodes:

51) DevId: the identifier of a sensor device, where the specific form ofthe DevId may differ in different sensor network technologies. Forexample, the identifier of a ZigBee device is a 64-bit extended IEEEaddress, while the identifier of a BlueTooth device is a 48-bit BD_ADDRaddress.

52) DevTyp: the type of a sensor device, where a specific form of theDevTyp may differ in different sensor network technologies. For example,ZigBee devices may be classified into a coordinator (Coordinator), arouter (Router), and an end device (End Device); while BlueTooth devicesmay be classified into a master device (Master), a slave device (Slave),or may be classified into a device of a basic rate, a device with anenhanced rate, a high-speed device, and an energy saving device.

53) Name: the name or nickname of a device.

54) LocAddr: the local address of a device for local communications of asensor network, where the specific form of the LocAddr may differ indifferent sensor network technologies. For example, a 16-bit networkaddress of a ZigBee device and a 3-bit LT ADDR of a BlueTooth device.For some sensor network devices which may have a plurality of localaddresses for different working modes or purposes (for example, aBlueTooth device may further include 8-bit PM_ADDR and AR_ADDR for aPark working mode), the node may also be configured to describe theplurality of different local addresses by including a plurality of childnodes.

55) Services: describing service provided by a sensor device, where eachservice is described by an MO child tree included in a corresponding <x>node, and the specific form of the MO child tree may differ in differentsensor network technologies. For example, service of a ZigBee device andservice of a BlueTooth device may be described by an MO child tree shownin FIG. 3 and that shown in FIG. 4, respectively.

FIG. 3 is a schematic diagram of an MO child tree of service of a ZigBeedevice in an embodiment of the present invention. For each ZigBeedevice, a service provided by the ZigBee device is run on acorresponding endpoint (EndPoint) and has a corresponding group andbinging relationship, so each service <x> may be described by MO nodesin the following:

31) EPNum: the sequence number (1-240) of an EndPoint for running theservice.

32) Descriptor: the descriptor for describing the service, where thespecific content may include, according to the ZigBee regulations, asimple descriptor (SimpleDescritpor) and a complex descriptor(ComplexDescritpor).

33) Groups: used to describe information of a group where the servicebelongs to, where each group where the service belongs to is identifiedby an <x> node. The following child nodes may be further included:

331) GroupName: used to describe a group name which is readable by auser.

332) GroupId: used to describe a group identifier, which specifically isa 16-bit group address.

333) Remove: indicating that the node is an executable node, configuredto instruct the removal of a current service from a current group.

34) Bindings: used to describe information related to bindings of acurrent service, where each binding relationship is represented by one<x>, and the following child nodes are further included:

341) Clusterld: the identifier of a cluster bound with a currentservice.

342) DstMode: the mode of a bound destination address, for example, agroup mode or a single device mode.

343) DstAddr: a bound destination address.

344) DstEP: the sequence number of an EndPoint of a bound destinationdevice, which is necessary only when the DstMode is the single devicemode.

345) Unbind: the node is an executable node, used to instruct theremoval of a current binding relationship of a current service.

35) Operations: used to provide a management operation method for acurrent service, and the following executable child nodes are included:

351) AddGroup: used to add a current service to specified groups, whereeach group is described by one <x> node, and child nodes, namely,GroupId and GroupName, used to specify an identifier and a name of thespecified group are further included.

352) RemoveAllGroups: used to remove a current service from all groupswhere the service is located.

353) Bind: used to add several pieces of binding information for acurrent service, where each piece of binding information is described byan <x> node, and the child nodes, namely, Clusterld, DstModeId, DstAddr,and DstEP, the meanings of which are the same as those of child nodescorresponding to the Services/<x>/Bindings/<x> node.

354) RemoveAllBindings: used to remove all binding relationships of acurrent service.

FIG. 4 is a schematic diagram of an MO child tree of service of aBlueTooth device according to an embodiment of the present invention.Referring to FIG. 4, for each BlueTooth device, each service <x>provided by the BlueTooth device is described by a series of attributes(Attribute). Each attribute is described by one <Attribute> MO node,which the following child nodes are further included:

AttributeId: the attribute identifier defined by the BlueToothregulations; and

AttributeValue: the value of an attribute.

56) Neighbors: describing a topology connection relationship between thesensor network device and a neighbor device, where each neighbor deviceis represented by one <x> node, and the following child nodes arefurther included:

561) Ref: directed to a link reference for describing the location of anMO node of the neighbor device (that is, Topo/DevList/<x> correspondingto the neighbor device), so that complete information of the neighbordevice may be acquired according to the reference.

562) DevId: optional, used to directly describe the device identifier ofthe neighbor device (the same as Topo/DevList/<x>/DevId), so that whenit is unnecessary to acquire the complete information of the neighbordevice, the device identifier of the neighbor device may be directlyacquired.

563) LQI: when being supported by the sensor network technologies, LQIis used to record the quality of the communication link between acurrent device and a neighbor device.

564) Relationship: describing a topology link relationship between theneighbor device and a current device, where the specific form of theRelationship may differ in different sensor network technologies. Forexample, relationships such as parent (Parent), child (Child), sibling(Sibling), and none (None) may be included among ZigBee devices, whilerelationships such as master (Master), slave (Slave), parked slave(Parked Slave), advertising (Advertising), and none (None) may beincluded among BlueTooth network devices.

565) Operations: providing a topology management operation for theneighbor sensor device through some executable child nodes, andincluding:

5651) Connect: used to instruct the current device to establish atopology connection relationship with the neighbor device, in which, forexample, assuming that a current Relationship with the neighbor deviceis None, a Parent (ZigBee network) or a Slave (BlueTooth network)relationship with the neighbor device may be established throughexecuting the MO node. If the current device has established a topologyconnection relationship with another neighbor device, according torequirements of a specific sensor network technology, the connectionrelationship with the other neighbor device might first need to bedisconnected.

5652) Ext: indicating that other topology management operation childnodes may also be extended for different sensor network technologies.For example, for a BlueTooth network, nodes of Park, Unpark, andSwitchRole may be extended to instruct the current device to send toneighbor device topology connection management commands such as parkinga slave device, activating a slave device, and switching a mater/slaverelationship, respectively.

57) Operations: providing a topology management operation for thecurrent sensor device through some executable child nodes, andincluding.

571) Disconnect: used to instruct the current device to leave the sensornetwork. For some sensor network technologies (for example, ZigBee)which support a multi-hop topology, the node may further include thefollowing child node:

5711) RemoveChildren: its value being TRUE or FALSE, used to, when thecurrent device is still connected to another child device or slavedevice, indicate the current device whether it is necessary to furtherremove the child device or the slave device from the sensor network.

572) Ext: other topology management operation child nodes may also beextended for different sensor network technologies.

58) Ext: for different sensor network technologies, other child nodesmay also be extended to describe information related to other topologiesof a current sensor network device. For example, for a ZigBee device, aPermitJoining node may be extended to record whether the current devicepermits other device to establish a topology connection relationshipwith the ZigBee device.

It should be noted that the management tree model used in sensor networkremote topology management is merely a typical example, where relativelocations or names of the MO nodes in the management tree may bedifferent in an actual deployment. The functions the same as those ofthe present invention can be implemented as long as the expressedmeanings are the same and a consistence is achieved between the gatewayand the remote device management server.

Step 12: The gateway manages the sensor network according to the DMcommand, where the management includes discovering the sensor networktopology, describing the sensor network topology, or modifying thesensor network topology.

For the discovering of the sensor network topology, a corresponding DMcommand is a DM discovery command. For the describing of the sensornetwork topology, a corresponding DM command is a DM get command. Forthe modifying of the sensor network topology, a corresponding DM commandis a DM modification command. Moreover, in specific implementation, theDM discovery command, the DM get command, and the DM modificationcommand may specifically be an Exec command, a Get command, a Replacecommand, and the like.

In this embodiment, a DM command is received through information of apreconstructed topology and a uniform management interface (that is, aDM protocol interface) consistent with remote device managementtechnologies in the prior art is used, so that an M2M service platform(or other device management servers) can perform remote topologymanagement and maintenance not only on the M2M gateway, but also on asensor network connected to the M2M gateway, thereby reducing thecomplexity of implementing the management.

The implementation of the function of remote topology management of thesensor network through the gateway is illustrated in the following withreference to the specific embodiments in combination with the foregoingmanagement tree model. (Because a portion of the gateway is definitely asensor network device, the following method is also applicable to thetopology management of the portion of the sensor network device in thegateway).

For the discovery procedure, the receiving the DM command sent by thedevice management server includes: receiving the DM discovery commandsent by the device management server, where the DM discovery commandacts on the fourth MO node.

The managing the sensor network according to the DM command includes:discovering a topology, and mapping and storing the topology to thesecond MO node. The discovering the topology includes at least one of:searching for information of an identifier and an address of a device,searching for additional information of the device, searching forinformation of an associated device, searching for information of aconnection status among the devices; and/or, discovering service, andmapping and storing the service to the third MO node. The discoveringthe service includes at least one of: searching for device serviceinformation, searching for group information related to the service ofthe device, and searching for binding information among the service ofthe device.

In addition, the fourth MO node further includes a child node configuredto indicate to report a subsequent topology change. The managing thesensor network according to the DM command further includes: detectingjoining or leaving of a sensor device; updating, according to thedetected joining or leaving of the sensor device in or from the sensornetwork, characteristic information of each sensor device and/ortopology connection relationship among sensor devices in the second MOnode, and/or, information about a service provided by each sensor devicein the third MO node; and reporting a notification message to the devicemanagement server. Furthermore, the notification message may notify thedevice management server that the updated information may be acquired,so that the device management server subsequently acquires the updatedtopology connection relationship among the sensor devices and/or theupdated information about a service provided by each sensor device. Thenotification message may also carry the updated topology connectionrelationship among the sensor devices and/or the information about aservice provided by each sensor device.

A ZigBee network and a BlueTooth network are described in the following:

FIG. 5A and FIG. 5B is a schematic flow chart of a method according toEmbodiment 2 of the present invention. This embodiment describes remotediscovery of a ZigBee network topology and device service informationthrough a gateway. Referring to FIG. 5A and FIG. 5B, this embodimentincludes the following steps:

Step 51: A device management server (DM Server) establishes a remote DMsession with an M2M gateway (M2M gateway).

The DM Server may also be an M2M service platform.

The DM server may establish the remote DM session with the M2M gatewayusing a standard DM protocol in the prior art. In the managementsession, the DM server can perform remote device management for the M2Mgateway using an existing DM technology.

Step 52: The DM server sends a DM execution (Exec) command(Exec:Topo/Operations/DiscTopoAndService) to the M2M gateway.

Specifically, if the DM server expects to further discover informationof a sensor network topology connected to the M2M gateway andinformation about a service provided by the sensor device, the DM serversends one DM command to the M2M gateway. The DM command specifically isthe DM execution (Exec) command, which acts on a management object,Topo/Operations/DiscTopoAndService, defined in FIG. 2. The meaning of“acts on” refers to appointing a path of a target MO node (that is, thelocation of the MO node in the MO tree,Topo/Operations/DiscTopoAndService in this embodiment), so that a DMclient determines for which MO node the DM command (Exec in thisembodiment) is executed.

Moreover, if the DM server does not need to obtain a notification of asubsequent change of the information of the sensor network topology orthe service information of the sensor device, it is unnecessary to set amanagement object Topo/Operations/DiscTopoAndService/Notification, orthe value of the management object is set to be FALSE.

Subsequently, the M2M gateway parses the DM command and determines thatit is necessary to complete the process of discovering information ofthe ZigBee network topology and service information of the ZigBee devicethrough a corresponding ZigBee protocol request. The step 53 ofdiscovering a topology includes the step 531 of searching foridentifiers and address information of a device and an associated deviceof the device, the step 532 of searching for additional information(type) of the device, and the step 533 of searching for a list ofneighbors of the device. The step 54 of discovering service includes thestep 541 of searching for an active end point (EndPoint, EP) on thedevice, the step 542 of traversing service on each EP, the step 543 oftraversing groups where each EP is located, and the step 544 ofsearching for a list of device service binding relationships.

The step 531 of searching for an IEEE address of the device and theassociated device includes the following steps:

Step 5311: The M2M gateway sends an IEEE address search request(IEEE_Addr_req) to the ZigBee device.

Specifically, the M2M gateway sends the IEEE address search request(IEEE_Addr_req) in sequence to devices (ZigBee Device) in the ZigBeenetwork where the M2M gateway is located, which carries a networkaddress (NwkAddr, starting from a ZigBee coordinator 0x0000) and anextended response indication parameter (Extended) of a target device,where the target device refers to a corresponding ZigBee device eachtime the search is performed.

Step 5312: The ZigBee device returns an IEEE address search response(IEEE_Addr_rsp) to the M2M gateway.

Specifically, the target device returns the IEEE address search response(IEEE_Addr_rsp) to the M2M gateway, where the IEEE address of the targetdevice is returned through a parameter IEEEAddr, and a list of networkaddresses of ZigBee devices associated with the target device isreturned through a parameter NWKAddrAssocDevList.

According to the list of the network addresses of the associated ZigBeedevices, the M2M gateway may perform iteration one by one using the samemethod to discover information of all ZigBee devices in the wholenetwork and IEEE addresses of the ZigBee devices, map the informationall ZigBee devices in the whole network and IEEE addresses of the ZibBeedevices to a Topo/DevList/<x>/DevId node in the gateway MO tree, and atthe same time map network addresses of all the ZigBee devices to aTopo/DevList/<x>/LocAddr node in the gateway MO tree.

The searching for additional information of the device (for example, atype or name of the device) 532 includes the following steps.

Step 5321: The M2M gateway sends a basic information search request(Node_Desc_req) to the ZigBee device.

Specifically, the M2M gateway sends the basic information search request(Node_Desc_req), which carries a network address (NwkAddr=0x?) of thetarget device, to all devices in the ZigBee network where the M2Mgateway is located.

Step 5322: The ZigBee device returns a basic information search response(Node_Desc_rsp) to the M2M gateway.

Specifically, the target device returns the basic information searchresponse (Node_Desc_rsp) to the M2M gateway, where the type of thedevice is returned through a parameter NodeDescriptor in the responsemessage, and the type is mapped to a Topo/DevList/<x>/DevTyp node in theMO tree by the M2M gateway.

The step 533 of searching for the list of neighbors of the deviceincludes the following steps:

Step 5331: The M2M gateway sends a link quality search request(Mgmt_Lqi_req) to the ZigBee device.

Specifically, the M2M gateway sends the link quality search request(Mgmt_Lqi_req), which carries the network address and a start index(NwkAddr, StartIndex) of the target device, to all devices in the ZigBeenetwork where the M2M gateway is located.

Step 5332: The ZigBee device returns a link quality search response(Mgmt_Lqi_rsp) to the M2M gateway.

Specifically, the target device returns the link quality search response(Mgmt_Lqi_rsp) to the M2M gateway. where the information of all neighbordevices can be discovered is returned through a parameterNeighborTableList in the response message, and the information of allneighbor devices includes the information of link quality and theinformation of a topology connection relationship, and the returnedinformation of all neighbor devices is mapped one by one to aTopo/DevList/<x>/Neighbors/<x> node in the MO tree by the M2M gateway.

The step 541 of searching for the active end point (EndPoint, EP) on thedevice includes the following steps:

Step 5411: The M2M gateway sends an EndPoint search request(Active_Ep_req) to the ZigBee device.

Specifically, according to a topology discovery result in step 53, theM2M gateway sends the EndPoint search request (Active_Ep_req) to alldevices in the ZigBee network where the M2M gateway is located, where,the EndPoint search request (Active_Ep_req) carries the network address(NwkAddr) of the target device.

Step 5412: The ZigBee device returns an EndPoint search response(Active_Ep_rsp) to the M2M gateway.

Specifically, the target device returns the EndPoint search response(Active_Ep_rsp) to the M2M gateway, where a list of EndPoints activatedby the target device is returned through a parameter ActiveEPList in theresponse message, and the list of EndPoints is mapped to aTopo/DevList/<x>/Services/<x>/EPNum node in the MO tree by the M2Mgateway.

The step 542 of traversing the service on each EP includes the followingsteps:

Step 5421: The M2M gateway sends a simple description search request(Simple_Desc_req) to the ZigBee device.

Specifically, according to a search result in step 541, the M2M gatewayfurther sends the simple service information search request(Simple_Desc_req) to each activated EndPoint of all ZigBee devices,where, the Simple_Desc_req carries the network address (NwkAddr) and thesequence number of an EndPoint (EP) of the target device.

Step 5422: The ZigBee device returns a simple service information searchresponse (Simple_Desc_rsp) to the M2M gateway.

Specifically, the target device returns the simple description searchresponse (Simple_Desc_rsp) to the M2M gateway, where, the descriptioninformation of a service run by a specified EndPoint is returned througha SimpleDescriptor parameter in the response message, and thedescription information is mapped to aTopo/DevList/<x>/Services/<x>/Descriptor node in the MO tree by the M2Mgateway.

The step 543 of traversing the group where each EP is located includesthe following steps:

Step 5431: The M2M gateway sends a group search request(Get_GroupMembership_req) to the ZigBee device.

Specifically, according to the search result in step 541, the M2Mgateway further sends the group search request (Get_GroupMembership_req)to each activated EndPoint of all ZigBee devices, where, the groupsearch request carries the network address (NwkAddr) and the sequencenumber of an EndPoint (EP) of the target device.

Step 5432: The ZigBee device returns a group search response(Get_GroupMembership_rsp) to the M2M gateway.

Specifically, the target device returns the group search response(Get_GroupMembership_rsp) to the M2M gateway, where, the information ofa table of groups where the specified EndPoint is run is returnedthrough a parameter GroupList in the response message, and theinformation of the table of groups is mapped to aTopo/DevList/<x>/Services/<x>/Groups node in the MO tree by the M2Mgateway.

The step 544 of searching for the list of device service bindingrelationship includes the following steps:

Step 5441: The M2M gateway sends a binding information search request(Mgmt_Bind_req) to the ZigBee device.

Specifically,

according to the topology discovery result in step 541, the M2M gatewaysends the binding information search request (Mgmt_Bind_req) to alldevices in the ZigBee network where the M2M gateway is located, where,the binding information search request carries the network address andthe start index (NwkAddr, StartIndex) of the target device.

Step 5442: The ZigBee device returns a binding information searchresponse (Mgmt_Bind_rsp) to the M2M gateway.

Specifically, the target device returns the binding information searchresponse (Mgmt_Bind_rsp) to the M2M gateway, where a list of servicebinding information of the target device is returned through aBindingTableList parameter in the response message, and the list ofservice binding information is mapped to aTopo/DevList/<x>/Services/<x>/Bindings node in the MO tree by the M2Mgateway.

Step 55: The M2M gateway returns a success response (Alert:OK) to the DMserver.

Specifically, the M2M gateway sends a DM response message to the devicemanagement server, where, the carried <Alert> element indicates that atopology management function of discovering the information of theZigBee network topology and the topology management function ofdiscovering the service information of the ZigBee device is successfullyexecuted.

Step 56: Acquire topology information and service information of eachdevice, which includes the following steps:

Step 561: The DM server sends a DM get (Get) command(Get:Topo/DevList?list=StructData) to the M2M gateway.

Specifically, the DM server sends to the M2M gateway one DM get (Get)command, which acts on a Topo/DevList management object node shown inFIG. 2. and the DM get command further carries a parameterlist=StructData for instructing the M2M gateway to return a child treestructure and a value of each node under Topo/DevList node.

Step 562: The M2M gateway returns a result (Result:./GW/DevList/ . . . )to the DM server.

Specifically, the M2M gateway returns the result to the DM server so asto restore the information of the ZigBee network topology and theservice information of the ZigBee device acquired by the M2M gateway,where, the result carries the child tree structure and the value of eachnode (Result:./GW/DevList/ . . . ) under the Topo/DevList node.

In addition, the device management server may also send to the M2Mgateway one DM get (Get) command, which acts on management object nodessuch as the Topo/NetworkId or the Topo/TopoTyp shown in FIG. 2 toacquire information of another related network topology.

It should be noted that:

in step 56, the DM server also may send to the M2M gateway the DM get(Get) command and acts on some specific management object nodes(Topo/DevList/<x>/Neighbors), so as to acquire a portion of theinformation of the network topology or a portion of the device serviceinformation.

In this embodiment, the DM server sends the DM command to the M2Mgateway. The DM command acts on the MO information for discovering theZigBee network topology and the device service information, so as toconveniently implement the discovery of the ZigBee network topology andthe device service information.

FIG. 6 is a schematic flow chart of a method according to Embodiment 3of the present invention. This embodiment describes the step ofreporting joining/leaving of a ZigBee network device through a gateway.Referring to FIG. 6, this embodiment includes the following steps:

Step 61: A device management server (DM Server) establishes a remote DMsession with an M2M gateway (M2M gateway).

For the specific content, refer to step 51.

Step 62: The DM server sends a DM replacement (Replace) and an execution(Exec) command (Replace: Topo/Operations/DiscTopo/Notification=True;Exec:Topo/Operations/DiscTopo) to the M2M gateway.

Specifically, if the DM server may obtain a notification of a change ofthe topology information after the DM server discovers the informationof a sensor network topology connected to the M2M gateway the DM serverfirst sends to the M2M gateway one DM replacement (Replace) command,where, the replacement command acts on the management object nodeTopo/Operations/DiscTopo/Notification defined in FIG. 2, and the valueof the node is set to be TRUE or is set to be the address identifier ofthe device management server, and then the DM server sends to the M2Mgateway one DM execution (Exec) command, which acts on the nodeTopo/Operations/DiscTopo.

The M2M gateway parses the DM command and determines that it isnecessary to complete the process of discovering the information of thesensor network topology through a corresponding sensor network protocolrequest, and that it is necessary to report a subsequent topologyinformation update, which specifically includes the following steps:

Step 63: The process of discovering a ZigBee network topology.

For the specific content, refer to step 53, step 55, and step 56 in FIG.5A and FIG. 5B.

Step 64: Detect joining/leaving of a device, which specifically includesthe following steps:

Step 641: A ZigBee device sends a leaving message (Nwk_leave) to the M2Mgateway.

Specifically, when a ZigBee device leaves the ZigBee network managed bythe gateway, the ZigBee device sends a leaving message (Nwk_leave) tothe M2M gateway, where, the leaving massage carries a parameter IEEEAddrthat indicates leaving, and the gateway learns about the leaving of theZigBee device according to the parameter IEEEAddr.

Step 642: The ZigBee device sends a notification message (Device_annce)to the M2M gateway.

Specifically, when a ZigBee device joins in the ZigBee network managedby the gateway, the ZigBee device sends a notification message(Device_annce) to the M2M gateway, where, the notification messagecarries a network address (NwkAddr) and a IEEEAddr parameter thatindicates joining, and the gateway learns about the joining of the newdevice according to the IEEEAddr parameter.

Step 641 and step 642 are not necessarily in chronological order.

Step 65: The M2M gateway updates device list information.

According to the information of the leaving or the joining of the ZigBeedevice, the M2M gateway updates the information of the topologymanagement tree in FIG. 2, removes topology and service informationrelated to the ZigBee device which has left, and adds topology andservice information related to the newly joined ZigBee device.

Step 66: The M2M gateway sends a notification message (Alert: TopologyChanged) to the DM server.

Specifically, according to the setting information of theTopo/Operations/DiscTopo/Notification node in step 62, the M2M gatewaysends a DM notification message to the device management server, where<Alert> may be used to indicate that the notification is used forreporting a change of the sensor network topology information (Alert:Topology Changed).

Step 67: Rediscover the ZigBee network topology and device serviceinformation through the gateway.

Specifically, similar to step 56, the DM server further acquires,according to the notification in step 66, the updated ZigBee sensornetwork topology information from the M2M gateway; or, similar to step52 to step 56, the DM server executes the process of discovering sensornetwork topology information and device service information again.

In this embodiment, the DM server sends a DM command to the M2M gateway.The DM command acts on MO information for reporting joining/leaving of aZigBee network device, so as to conveniently implement the reporting ofthe joining/leaving of the ZigBee network device.

FIG. 7A and FIG. 7B are a schematic flow chart of a method according toEmbodiment 4 of the present invention. This embodiment describes thediscovery of a BlueTooth network topology and device service informationthrough a gateway. Referring to FIG. 7A and FIG. 7B, this embodimentincludes the following steps:

Step 701: A device management server (DM Server) establishes a remote DMsession with an M2M gateway (M2M gateway).

For the specific content, refer to step 51.

Step 702: The DM server sends to the M2M gateway a DM replacement(Replace) command and a DM execution (Exec) command

-   -   (Replace:Topo/Operations/DiscTopoAndService/Notification=True        and Exec: Topo/Operations/DiscTopoAndService).

Specifically, if the DM server expects to further obtain, afterdiscovering the sensor network topology information and the deviceservice information, a notification of a change of the information, theDM server first sends to the M2M gateway one DM replacement (Replace)command, where, the DM replacement command acts on the management objectnode Topo/Operations/DiscTopoAndService/Notification defined in FIG. 2,and the value of the node is set to be TRUE or is set to be an addressidentifier of the device management server. And then the DM server sendsto the M2M gateway one DM execution (Exec) command, which acts on thenode Topo/Operations/DiscTopoAndService. The M2M gateway parses the DMcommand and determines that it is necessary to complete the process ofdiscovering information of the BlueTooth network topology and the deviceservice through a corresponding BlueTooth protocol request, and that itis necessary to report a subsequent information update.

Step 703: Discover a topology, which includes the following steps:

Step 7031: Search for the address identifier of a device, which includesthe following steps:

Step 70311: The M2M gateway sends a BlueTooth inquiry request(Inquiry_req) to a BlueTooth device (BT device).

Specifically, the M2M gateway advertises the BlueTooth inquiry request(Inquiry_req) to the vicinity.

Step 70312: The BlueTooth device returns an inquiry response(Inquiry_rsp) to the M2M gateway.

If a neighbor BlueTooth device receives the request, the neighborBlueTooth device returns an inquiry response (Inquiry_rsp) and carries adevice identifier of the neighbor BlueTooth device through a BD_ADDRparameter. The M2M gateway maps the device identifier to aTopo/DevList/<x>/DevId node in the gateway MO tree.

Optionally, if the neighbor BlueTooth device supports an extendedinquiry response message (Extended_Inquiry_rsp), the neighbor BlueToothdevice may further return information such as the name (name) andprovided service (services) of the device to the gateway, which are thenmapped by the gateway to a Topo/DevList/<x>/Name node and aTopo/DevList/<x>/Service node, respectively.

Step 7032: Search for additional information of the device, whichincludes the following steps:

Step 70321: The M2M gateway sends a name inquiry request (LMP_Name_req)to the BT device.

Specifically, the M2M gateway sends the name inquiry request(LMP_Name_req) in a sequence to all devices in the BlueTooth networkwhere the M2M gateway is located, where, the name inquiry requestcarries a network address (BD_ADDR) of a target device.

Step 70322: The BT device returns a name inquiry response (LMP_Name_rsp)to the M2M gateway.

Specifically, the target device returns the name inquiry response(LMP_Name_rsp) to the M2M gateway, where a name of the device isreturned through a Name parameter in a response message, and the name ismapped to a Topo/DevList/<x>/Name node in the MO tree by the M2Mgateway.

It is understandable that, if the name is acquired in step 70312, thestep of acquiring the name in step 7032 is not required.

Step 704: Discover a service, which includes the following steps:

Step 7041: Search for device service information, which includes thefollowing steps:

Step 70411: The M2M gateway sends a service search request(SDP_ServiceSearchAttribute_req) to the BT device.

Specifically, the M2M gateway sends the service search request(SDP_ServiceSearchAttribute_req) to all devices in the BlueTooth networkwhere the M2M gateway is located, where, the service search requestcarries the network address of the target device and a parameterServiceSearchPattern=PublicBrowseRoot.

Step 70412: The BT device returns a service search response(SDP_ServiceSearchAttribute_rsp) to the M2M gateway.

Specifically, the target device returns the service search response(SDP_ServiceSearchAttribute_rsp) to the M2M gateway, where theinformation of a list of service provided by the target device isreturned through a parameter ServiceAttributeList in the responsemessage, and the service are mapped one by one to aTopo/DevList/<x>/Service/<x>/<Attributes> node in the MO tree by the M2Mgateway.

Step 705: The M2M gateway returns a success response (Alert:OK) to theDM server.

Specifically, the M2M gateway sends a DM response message to the devicemanagement server, where the carried <Alert> element indicates that thetopology management function of discovering the information of theBlueTooth network topology and the service information of the ZigBeedevice is successfully executed.

Step 706: Acquire topology information and service information of eachdevice.

For the specific content, refer to step 56.

Furthermore, this embodiment may also include the following steps.

Step 707: Detect joining/leaving of a device in or from the BlueToothnetwork, which includes the following steps:

For a joining scenario, in step 7071, when a device joins in theBlueTooth network managed by the gateway, the BlueTooth device sends aBlueTooth connection establishment request (LMP_Host_Connection_req) tothe M2M gateway, where a BD_ADDR parameter indicates the identifier ofthe joined device.

Step 7072: The M2M gateway returns a BlueTooth connection establishmentcomplete (LMP_Setup_Complete) message to the BlueTooth device to confirmthat the device has successfully joined in the network.

Alternatively,

for a leaving scenario:

Step 7073: When a device is leaving, the BlueTooth device sends aleaving (LMP_Detach) message to the M2M gateway.

Step 7074: The M2M gateway may determine, according to a currentconnection corresponding to the leaving message, the identifier of thedevice which has left and return an acknowledgment (BB-Ack) message tothe BlueTooth device.

Step 708: Update device list information.

Specifically, according to the information of the leaving or the joiningof the BlueTooth device, the M2M gateway updates the information of thetopology management tree in FIG. 2, removes topology and serviceinformation related to the device which has left, and adds topology andservice information related to the newly joined device.

Step 709: The M2M gateway sends a notification message (Alert: TopologyChanged) to the DM server.

Specifically, according to the setting condition of theTopo/Operations/DiscTopoAndService/Notification node in step 702, theM2M gateway sends the DM notification message to the device managementserver, where <Alert> may be used to indicate that the notification isused for reporting a change of the sensor network topology information.

Step 710: Rediscover the BlueTooth network topology and serviceinformation of the BlueTooth device through the gateway.

Specifically, similar to step 706, the DM server further acquires,according to the notification in step 705, the updated BlueTooth sensornetwork topology information from the M2M gateway; or, similar to step702 to step 706, the device management server executes the process ofdiscovering sensor network topology information and device serviceinformation again.

In this embodiment, the DM server sends the DM command to the M2Mgateway. The DM command acts on the MO information for discovering theBlueTooth network topology and the device service information, so as toconveniently implement the discovery of the BlueTooth network topologyand the device service information.

A modification procedure includes removing a specified device, removinga specified device and a child device of the specified device, adding aspecified device, and changing a topology connection relationshipbetween a specified device and a neighbor device.

During the removal of a specified device, the receiving the DM commandsent by the device management server includes: receiving a DMmodification command sent by the device management server, where the DMmodification command acts on the fifth MO node and the fifth MO node isspecifically configured to remove the specified device from the sensornetwork; and the managing the sensor network according to the DM commandincludes: sending a removal command to the specified device, andupdating the characteristic information of each sensor device and/or thetopology connection relationship among the sensor devices in the secondMO node, and/or, the information about a service provided by each sensordevice in the third MO node.

During removal of a specified device and the child node thereof, thereceiving the DM command sent by the device management server includes:receiving a DM modification command sent by the device managementserver, where the DM modification command acts on the fifth MO node andthe fifth MO node is specifically configured to remove the specifieddevice and the child node thereof from the sensor network; and themanaging the sensor network according to the DM command includes:sending a removal command to the specified device, where the removalcommand includes indication information of removing the child device,and updating the characteristic information of each sensor device and/orthe topology connection relationship among the sensor devices in thesecond MO node, and/or, the information about a service provided by eachsensor device in the third MO node.

During the adding of a specified device, the receiving the DM commandsent by the device management server includes: receiving a DMmodification command sent by the device management server, where the DMmodification command acts on the fifth MO node and the fifth MO node isspecifically configured to add the specified device into the sensornetwork; and the managing the sensor network according to the DM commandincludes: sending a connection establishment request message to thespecified device and updating the characteristic information of eachsensor device and/or the topology connection relationship among thesensor devices in the second MO node, and/or, the information about aservice provided by each sensor device in the third MO node.

During the changing of a topology connection relationship between aspecified device and a neighbor device, the receiving the DM commandsent by the device management server includes: receiving a DMmodification command sent by the device management server, where the DMmodification command acts on the fifth MO node and the fifth MO node isspecifically configured to modify the topology connection relationshipbetween the specified device and the neighbor device; and the managingthe sensor network according to the DM command includes: permitting aspecified neighbor device to admit a new child device, prohibiting otherneighbor devices from admitting the child device, instructing thespecified device to rejoin in the network, and updating the topologyconnection relationship among the sensor devices in the second MO node.Through the foregoing processing, the specified device is enabled toestablish a connection relationship with the specified neighbor deviceand disconnect the connection relationships with other neighbor devices.

The topology information is modified in the foregoing, and serviceinformation may also be modified. At this time, the receiving the DMcommand sent by the device management server includes: receiving a DMmodification command sent by the device management server, where the DMmodification command acts on the sixth MO node. The managing the sensornetwork according to the DM command includes: modifying serviceinformation related to a specified sensor network device, including:modifying a group and/or binding relationship of a specified service,and updating the information about a service provided by a specifiedsensor device in the third MO node. The following provides an embodimentin the foregoing modification condition in combination with a specificsensor network.

After the above discovery procedure, or further after the modificationprocedure, the description nodes (the first MO node, the second MO node,and the third MO node) store corresponding information, and at thistime, an acquisition procedure may be performed, so that the gatewaysends the corresponding information to the device management server.

Specifically, the receiving the DM command sent by the device managementserver includes: receiving a DM get command sent by the devicemanagement server, where the DM get command acts on the first MO node.The managing the sensor network according to the DM command includes:sending the overall information of the sensor network stored in thefirst MO node to the device management server.

Alternatively, the receiving the DM command sent by the devicemanagement server includes: receiving a DM get command sent by thedevice management server, where the DM get command acts on the second MOnode.

The managing the sensor network according to the DM command includes:sending the characteristic information of each sensor device and/or theinformation of the topology connection relationship among the sensordevices stored in the second MO node to the device management server.

Alternatively, the receiving the DM command sent by the devicemanagement server includes: receiving a DM get command sent by thedevice management server, where the DM get command acts on the third MOnode. The managing the sensor network according to the DM commandincludes: sending the information about a service provided by eachsensor device stored in the third MO node to the device managementserver.

Of course, in the acquisition procedure, the information acquired fromthe second MO node and/or the third MO node is the updated informationif the updating is already performed, and otherwise the information isthe information mapped and stored initially.

Some modification embodiments are provided in the following incombination with specific scenarios.

FIG. 8 is a schematic flow chart of a method according to Embodiment 5of the present invention. This embodiment describes the removal of aZigBee device and a related child device through a gateway. Referring toFIG. 8, this embodiment includes the following steps:

It is assumed that, in this embodiment, a removed ZigBee device 1 isassociated with some child devices X.

Step 81: Establish a remote DM session.

For the specific content, refer to step 51.

Step 82: Discover a ZigBee network topology.

For the specific content, refer to step 52 to step 56.

Step 83: The DM server sends to the M2M gateway a DM replacement(Replace) command and a DM execution (Exec) command

-   -   (Topo/DevList/Dev1/Operations/Disconnect/RemoveChildren=True and        Exec:Topo/DevList/Dev1/Operations/Disconnect).

Specifically, if the device management server expects to remove theZigBee device 1 (Dev1) and all child devices X (DevX) associated withthe ZigBee device 1, the device management server first sends to the M2Mgateway one DM replacement (Replace) command, which acts on the MO nodeTopo/DevList/Dev1/Operations/Disconnect/RemoveChildren corresponding tothe device 1 defined in FIG. 2, where the value of the node is TRUE, andthen the device management server sends to the M2M gateway one DMexecution (Exec) command, which acts on a nodeTopo/DevList/Dev1/Operations/Disconnect. The M2M gateway parses the DMcommand and determines that it is necessary to remove the device 1 andall the associated child devices X in the current ZigBee network througha corresponding ZigBee protocol request.

Step 84: The M2M gateway sends to the ZigBee device 1 a device removalrequest (Mgmt_Leave_req). Where, the device removal request carries anetwork address (IEEEAddr=Dev1) of the ZigBee device 1 and a parameterRemoveChildren=TRUE for instructing the ZigBee device 1 to furtherremove all the child devices associated with the ZigBee device 1.

Step 85: Remove all the child devices, which includes the followingsteps:

Step 851: The ZigBee device 1 sends the device removal request(Mgmt_Leave_req) to all the child devices X associated with the ZigBeedevice 1, where, the device removal request carries network addresses ofthe devices X and parameters RemoveChildren=TRUE for instructing thedevices X to further remove all child devices associated with thedevices X.

Step 852: After the devices X remove all the child devices associated ata low layer to the devices X according to the same method, the devices Xeach return a device removal response (Mgmt_Leave_rsp) to the ZigBeedevice 1 and enable the devices X to leave the current ZigBee network,where, the device removal response which carries the success information(SUCCESS).

Step 86: The ZigBee device 1 sends the device removal response(Mgmt_Leave_rsp), which carries success information (SUCCESS), to theM2M gateway and enables the ZigBee device 1 to leave the current ZigBeenetwork.

Step 87: The M2M gateway updates the device list information.

Specifically, according to the information of the network topology afterthe device is removed, the M2M gateway updates the information of thetopology management tree in FIG. 2 and removes topology and serviceinformation related to the device which has left.

Step 88: The M2M gateway returns a success response (Alert:OK) to the DMserver.

Specifically, the M2M gateway sends a DM response message to the DMserver, where the carried element of <Alert>: OK indicates that atopology management function of removing the ZigBee device 1 and all thechild devices associated with the ZigBee device 1 is successfullyexecuted.

It should be noted that, if the device management server expects toremove only the ZigBee device 1 but not to remove all the child devicesX (DevX) associated with the ZigBee device 1, in step 83, the value ofthe Topo/DevList/Dev1/Operations/Disconnect/RemoveChildren node isFALSE, or the node is not set, in step 84, the parameterRemoveChildren=FALSE, and it is unnecessary to execute step 85.

In this embodiment, the DM server sends a DM command to the M2M gateway.The DM command acts on MO information for removing a ZigBee device andassociated child devices, so as to conveniently remove the ZigBee deviceand the associated child devices.

FIG. 9 is a schematic flow chart of a method according to Embodiment 6of the present invention. This embodiment describes removal or adding ofa BlueTooth slave device through a gateway. Referring to FIG. 9, thisembodiment includes the following steps:

It is assumed that the M2M gateway (Dev0) serves as a master device(Master) in a BlueTooth network, a BlueTooth device 1 (Dev1) serves as aslave device (Slave), and a BlueTooth device 2 has not joined in thecurrent BlueTooth network yet, but is turned on and in a working statusto be discoverable by the M2M gateway.

Step 91: Establish a remote DM session.

For the specific content, refer to step 701.

Step 92: Discover a BT network topology.

For the specific content, refer to step 702 to step 706.

Step 93: Remove a BlueTooth slave device, which includes the followingsteps:

Step 931: The DM server sends a DM execution (Exec) command(Exec:Topo/DevList/Dev1/Operations/Disconnect) to the M2M gateway.

Specifically, according to a BlueTooth network topology discovery resultin step 92, if the device management server expects to remove theBlueTooth slave device 1 (Dev1), the device management server sends tothe M2M gateway one DM execution (Exec) command, which acts on an MOnode Topo/DevList/Dev1/Operations/Disconnect corresponding to the device1 defined in FIG. 2. The M2M gateway parses the DM command anddetermines that it is necessary to remove the device 1 in the currentBlueTooth network according to a corresponding BlueTooth protocolrequest.

Step 932: The M2M gateway sends a device removal request (LMP_Detach) tothe BlueTooth device 1.

Step 933: The BlueTooth device 1 sends a device removal response(BB_Ack) to the M2M gateway, where the acknowledgment of successfulremoval of the device is obtained through the response message.

Step 94: Add one BlueTooth slave device.

Step 941: The DM server sends a DM execution (Exec) command(Exec:Topo/DevList/Dev0/Neighbors/Dev2/Operations/Connect) to the M2Mgateway.

Specifically, according to a BlueTooth network topology discovery resultin step 92, if the device management server expects to add the BlueToothdevice 2 (Dev2) as a slave device into the current BlueTooth network,the device management server sends to the M2M gateway one DM execution(Exec) command, which acts on an MO nodeTopo/DevList/Dev0/Neighbors/Dev2/Connect defined in FIG. 2. The M2Mgateway parses the DM command and determines that it is necessary to adda neighbor BlueTooth device 2 discovered by the M2M gateway as a slavedevice into the current BlueTooth network through a correspondingBlueTooth protocol request.

Step 942: The M2M gateway (that is, the master device 0 of the BlueToothnetwork) sends a connection establishment request(LMP_Host_Connection_req), which carries a network address(BD_ADDR=Dev2) of the device 2, to the BlueTooth device 2.

Step 943: If the device 2 agrees to join in the current BlueToothnetwork, the device 2 returns a connection establishment completemessage LMP_Setup_Complete to the M2M gateway to acknowledge that thedevice 2 has joined in the current BlueTooth network.

Step 95: The M2M gateway updates device list information.

Specifically, according to the condition of the network topology afterthe device is removed or added, the M2M gateway updates the informationof the topology management tree shown in FIG. 2, that is, removestopology and service information related to the device which has left,and adds topology and service information related to the newly joineddevice.

Step 96: The M2M gateway returns a success response (Alert:OK) to the DMserver.

Specifically, the M2M gateway sends a DM response message to the devicemanagement server, where the carried <Alert> element indicates that thetopology management function of removing or adding a BlueTooth device issuccessfully executed.

It should be noted that:

step 93 and step 94 are operation steps independent from each other, sostep 95 and step 96 may occur after step 93, and also may occur afterstep 94.

In this embodiment, the DM server sends a DM command to the M2M gateway.The DM command acts on MO information for removing or adding a BlueToothslave device, so as to conveniently implement the removal or adding of aBlueTooth slave device.

FIG. 10 is a schematic flow chart of a method according to Embodiment 7of the present invention. This embodiment describes remote modificationof service information of a ZigBee device through a gateway. Referringto FIG. 10, this embodiment includes the following steps:

Since a ZigBee network supports the function of remote serviceconfiguration, a device management server can remotely modify, throughan M2M gateway, service information of a specified ZigBee deviceaccording to an MO management tree shown in FIG. 3. The serviceinformation includes information of a group where a service is locatedand binding information related to the service. This embodiment onlytakes the modification of the group information as example. Theoperation method of modifying the binding information related to theservice is similar, which is not described again.

Step 101: Establish a remote DM session.

For the specific content, refer to step 51.

Step 102: Discover a ZigBee network topology.

For the specific content, refer to step 52 to step 56.

Step 103: The DM server sends to the M2M gateway a DM replacement(Replace) command and a DM execution (Exec) command(Replace:Topo/DevList/Dev1/Services/Sev1/Operations/AddGroup/<x>/GroupId;Replace:Topo/DevList/Dev1/Services/Sev1/Operations/AddGroup/<x>/GroupName;and Exec:Topo/DevList/Dev1/Services/Sev1/Operations/AddGroup).

Specifically, according to the result of discovering the ZigBee networktopology and the device service information in step 102, if the devicemanagement server expects to add information of a group where a service1 (Sev1) of a device 1 (Dev1) is located for the service 1 and thedevice 1, the device management server first sends to the M2M gatewaytwo DM replacement (Replace) commands, which act on an MO nodeTopo/DevList/Dev1/Services/Sev1/Operations/AddGroup/<x>/GroupId and anMO nodeTopo/DevList/Dev1/Services/Sev1/Operations/AddGroup/<x>/GroupNamedefined in FIG. 2 and FIG. 3 respectively and are configured to set agroup identifier and a group name to be added. If multiple pieces ofgroup information expect to be added, the adding can be implementedthrough setting GroupId nodes and GroupName nodes under the plurality of<x> nodes. Then the device management server again sends to the M2Mgateway one DM execution (Exec) command, which acts on an MO nodeTopo/DevList/Dev1/Services/Sev1/Operations/AddGroup. The M2M gatewayparses the DM command and determines that it is necessary to addcorresponding group information for the service 1 on the ZigBee device 1through a corresponding ZigBee protocol request.

Step 104: Add group information of the device service, which includesthe following steps:

Step 1041: The M2M gateway sends to the ZigBee device an add grouprequest (Add_Group_req), which carries a sequence number of an EndPointwhere the service 1 on the device 1 is located and the configured groupidentifier (GroupId) and the group name (GroupName) to be added.

Specifically, the M2M gateway first acquires, according to themanagement tree defined in FIG. 3, a sequence number of the EndPoint(EPNum) where the service 1 on the device 1 is located, and then sendsto the ZigBee device 1 an add group request Add_Group_req, which carriesthe sequence number of the EndPoint where the service 1 on the device 1is located and the configured group identifier (GroupId) and the groupname (GroupName) to be added. The device 1 updates, according to therequest, group table information related to a local service, and thenreturns a response of adding a group successfully to the M2M gateway.

Step 1042: The ZigBee device updates a local group table (GroupTable).

Step 1043: The ZigBee returns a response of adding a group successfully(Add_Group_rsp(SUCCESS)) to the M2M gateway.

Step 105: The M2M gateway updates group information of a correspondingdevice.

Specifically, the M2M gateway updates the information of the topologymanagement tree shown in FIG. 2 and FIG. 3, that is, adds the groupinformation of the service 1 on the device 1.

Step 106: The M2M gateway returns a success response (Alert:OK) to theDM server.

Specifically, the M2M gateway sends a DM response message to the devicemanagement server, where the carried <Alert> element indicates that atopology management function of modifying the device service informationis successfully executed.

It should be noted that:

if a remote device management server needs to modify other serviceinformation on a specified ZigBee device, in step 103, the remote devicemanagement server send, according to the information of the topologymanagement tree shown in FIG. 3, to the M2M gateway a replacement(Replace) command and an execution (Exec) command which act oncorresponding MO nodes, that is, instruct the M2M gateway to executecorresponding management operation of modifying the device serviceinformation, for example, add service binding information through ExecTopo/DevList/Dev1/Services/Sev1/Operations/Bind and remove groupinformation through ExecTopo/DevList/Dev1/Services/Sev1/Operations/RemoveAllGroups or ExecTopo/DevList/Dev1/Services/Sev1/Groups/<x>/Remove.

In this embodiment, the DM server sends a DM command to the M2M gateway.The DM command acts on MO information for remotely modifying the serviceinformation of the ZigBee device, so as to conveniently implement theremote modification of the service information of the ZigBee device.

FIG. 11A and FIG. 11B a schematic flow chart of a method according toEmbodiment 8 of the present invention. This embodiment describes themodification of a topology connection relationship among ZigBee devicesthrough a gateway. Referring to FIG. 11A and FIG. 11B, this embodimentincludes the following steps:

It is assumed in this embodiment that a ZigBee device 1 is originallyconnected to a device 3 which is a parent device of the ZigBee device 1and then expects to be connected to a device 2 serving as a parentdevice of the ZigBee device 1.

Step 1101: Establish a remote DM session.

For the specific content, refer to step 51.

Step 1102: Discover a ZigBee network topology.

For the specific content, refer to step 52 to step 56.

It is assumed that, at this time, a device management server discoversthat the ZigBee device 1 (Dev1) is already connected to the neighborparent device 3 (Dev3) (a neighbor relationship is: Relationship=Parent)and the neighbor device 2 (Dev2) also presents around that may serve asthe parent device to be connected to the ZigBee device 1 (a neighborrelationship is: Relationship=None).

Step 1103: The DM server sends a DM execution (Exec) command(Exec:Topo/DevList/Dev1/Neighbors/Dev2/Operations/Connect) to the M2Mgateway.

Specifically, if the device management server expects to move theconnection of the ZigBee device 1 (Dev1) from the current parent device3 (Dev3) to the device 2 (Dev2), the device management server sends tothe M2M gateway one DM execution (Exec) command, which acts on an MOnode Topo/DevList/Dev1/Neighbors/Dev2/Operations/Connect correspondingto the device 1 defined in FIG. 2. The M2M gateway parses the DM commandand determines that it is necessary to remove the ZigBee device 1 fromthe current parent device 3 (Dev3) and then reconnect the ZigBee device1 to the parent device 2 (Dev2) according to a corresponding ZigBeeprotocol request.

Step 1104: The M2M gateway stores configuration information of therelated devices.

Specifically, since the establishment of connections among the devicesin the ZigBee network is completed in a self-organized manner and theZigBee protocol does not directly provide an operation method forestablishing a connection between one ZigBee device (Dev1) and aspecified parent device (Dev2), an intermediate operation is required toimplement the establishment of the connection. The specific method is:first disabling the function of permitting child device connection(modifying a parameter of PermitDuration to be 0x00) of all other ZigBeedevices around the Dev1 device other than the Dev2; and then instructingthe Dev1 to leave the current ZigBee network and rejoin in the networkagain, at this time, through the process of spontaneously joining in anetwork, the Dev1 only can choose the Dev2 as the parent device toestablish a connection, so as to achieve an expected effect of modifyingthe topology. In order to ensure the working status of the devices inthe ZigBee network to be consistent with the working status before thetopology is modified, it is necessary to store related parameters of thedevices, for example, PermitDuration.

Step 1105: Permit the Dev2 to admit a new child device and prohibitother device from admitting the child device, which includes thefollowing steps:

Step 11051: The M2M gateway sends a request for setting to permit achild device connection (Mgmt_Permit_Joining_req) to a neighbor device(for example, the ZigBee device 2) of the ZigBee device 1 (Dev1). Forthe device 2 (Dev2), a carried parameter PermitDuration=0xff indicatesthat the child device connection is permitted.

Step 11052: The ZigBee device 2 sends a success response message(Mgmt_Permit_Joining_rsp(SUCCESS)) to the M2M gateway to acknowledge thecompletion of setting.

Step 11053: The M2M gateway sends the request for setting to permit thechild device connection (Mgmt_Permit_Joining_req) to a neighbor device(for example, other ZigBee devices) of the ZigBee device 1 (Dev1). Forother neighbor devices, a carried parameter PermitDuration=0x00indicates that the child device connection is not permitted.

Step 11054: The other ZigBee devices send a success response message(Mgmt_Permit_Joining_rsp(SUCCESS)) to the M2M gateway to acknowledge thecompletion of setting.

Step 1106: Instruct the Dev1 to rejoin in the network. Specifically, theZigBee device 1 leaves the current network according to the request andthen executes the process of spontaneous network scanning and joining.Since only the neighbor device 2 (Dev2) permits the device 1 to join inthe network at this time, the device 1 (Dev1) only can use the device 2(Dev2) as the parent device thereof to establish a connection and thennotifies, through a device announcement request Device_annce, the M2Mgateway that the device 1 has rejoined in the network. Step 1106includes the following steps:

Step 11061: The M2M gateway sends a leaving network request(Mgmt_Leave_req) to the ZigBee device 1 (Dev1), where a carried IEEEAddrparameter indicates the identifier of the device 1, and at the sametime, a carried parameter Rejoin=True indicates that the device 1further needs scanning and rejoining after leaving the network.

Step 11062: The ZigBee device 1 sends to the M2M gateway a leavingnetwork response (Mgmt_Leave_rsp), which carries a SUCCESS parameter.

Step 11063: The ZigBee device 1 (Dev1) is associated with the ZigBeedevice 2 (Dev2) through a network scanning and joining process.

Step 11064: The ZigBee device 1 sends to the M2M gateway a notificationmessage (Device_annce), which carries a network address (NwkAddr) and anIEEE address (IEEEAddr).

Step 1107: If a change occurs, restore configuration information of therelated devices. Specifically, if the configuration parameter ofpermitting the child device connection of the neighbor device of thedevice 1 (Dev1) is modified in step 1105, as compared with step 1104, atthis time, the gateway needs to restore the configuration parameterstored in step 1104 to the corresponding device through a method similarto that in step 1105. Step 1107 includes the following steps:

Step 11071: The M2M gateway sends to the ZigBee device 2 the request forsetting to permit the child device connection (Mgmt_Permit_Joining_req),which carries a parameter PermitDuration=0x00, indicating that the childdevice connection is not limited.

Step 11072: The ZigBee device 2 sends a success response message(Mgmt_Permit_Joining_rsp(SUCCESS)) to the M2M gateway to acknowledge thecompletion of setting.

Step 11073: The M2M gateway sends to other ZigBee devices the requestfor setting to permit the child device connection(Mgmt_Permit_Joining_req), which carries the parameterPermitDuration=0xff, indicating that the child device connection ispermitted.

Step 11074: Other ZigBee devices send a success response message(Mgmt_Permit_Joining_rsp(SUCCESS)) to the M2M gateway to acknowledge thecompletion of setting.

Step 1108: Optionally, rediscover the network topology.

Specifically, optionally, the M2M gateway may execute a process fromstep 3 to step 9 in Embodiment 1 to rediscover the topology informationof the current ZigBee network and the device service information, so asto guarantee the accuracy of related information.

Step 1109: The M2M gateway updates the network topology information.

Specifically, according to the changed topology connection relationship,the M2M gateway updates the information of the topology management treesshown in FIG. 6 and FIG. 7A and FIG. 7B.

Step 1110: The M2M gateway returns a success response (Alert:OK) to theDM server.

Specifically, the M2M gateway sends a DM response message to the devicemanagement server, where the carried <Alert> element indicates that atopology management function of modifying the device service informationis successfully executed.

In this embodiment, the DM server sends a DM command to the M2M gateway.The DM command acts on MO information for modifying the topologyconnection relationship among the ZigBee devices, so as to convenientlyimplement the modification of the topology connection relationship amongthe ZigBee devices.

FIG. 12 is a schematic structural diagram of a gateway according toEmbodiment 9 of the present invention. The gateway includes a receivingmodule 121 and a management module 122. The receiving module 121 isconfigured to receive a DM command sent by a device management server.The DM command acts on a preconstructed MO node. The MO node includes anode configured to discover a sensor network topology, a node configuredto describe a sensor network topology, or a node configured to modify asensor network topology.

The management module 122 is configured to manage a sensor networkaccording to the DM command. The management includes discovering thesensor network topology, describing the sensor network topology, ormodifying the sensor network topology.

The node configured to describe a sensor network topology includes atleast one of: a first MO node configured to describe the overallinformation of the sensor network, a second MO node configured todescribe characteristic information of each sensor device and/orinformation of a topology connection relationship among the sensordevices, and a third MO node configured to describe information about aservice provided by each sensor device;

and/or,

the node configured to discover the sensor network topology includes: afourth MO node configured to discover the topology connectionrelationship among the sensor devices and/or the information about aservice provided by each sensor device;

and/or,

the node configured to modify a sensor network topology includes atleast one of: a fifth MO node configured to modify the topologyconnection relationship among the sensor devices and a sixth MO nodeconfigured to modify the information about a service provided by thesensor device.

Specifically, the receiving module 121 is specifically configured toreceive a DM discovery command sent by the device management server,where the DM discovery command acts on the fourth MO node. Themanagement module 122 is specifically configured to discover thetopology, and map and store the topology to the second MO node. Thetopology discovery includes at least one of: searching for theinformation of an identifier and an address of a device, searching foradditional information of the device, searching for information of anassociated device, searching for information of a connection statusamong the devices, and/or, discovering service, and mapping and storingthe service to the third MO node. The service discovery includes atleast one of: searching for device service information, searching forgroup information related to the service of the device, and searchingfor binding information among the service of the device. Furthermore,the management module 122 is further configured to: detect joining orleaving of the sensor device in or from the sensor network, update,according to a detected condition of the joining or leaving of thesensor device, the characteristic information of each sensor deviceand/or the topology connection relationship among the sensor devices inthe second MO node, and/or, the information about a service provided byeach sensor device in the third MO node, and report a notificationmessage to the device management server.

Alternatively,

the receiving module 121 is specifically configured to receive a DMmodification command sent by the device management server, where the DMmodification command acts on the fifth MO node and the fifth MO node isspecifically configured to remove a specified device from the sensornetwork; and the management module 122 is specifically configured tosend a removal command to the specified device and update thecharacteristic information of each sensor device and/or the topologyconnection relationship among the sensor devices in the second MO node,and/or, the information about a service provided by each sensor devicein the third MO node.

Alternatively,

the receiving module 121 is specifically configured to receive a DMmodification command sent by the device management server, where the DMmodification command acts on the fifth MO node and the fifth MO node isspecifically configured to remove a specified device and a child deviceof the specified device from the sensor network; and the managementmodule 122 is specifically configured to send a removal command to thespecified device, where the removal command includes indicationinformation of removing the child device, and update the characteristicinformation of each sensor device and/or the topology connectionrelationship among the sensor devices in the second MO node, and/or, theinformation about a service provided by each sensor device in the thirdMO node.

Alternatively,

the receiving module 121 is specifically configured to receive a DMmodification command sent by the device management server, where the DMmodification command acts on the fifth MO node and the fifth MO node isspecifically configured to add a specified device into the sensornetwork; and the management module 122 is specifically configured tosend a connection establishment request message to the specified deviceand update the topology connection relationship among the sensor devicesin the second MO node, and/or, the information about a service providedby each sensor device in the third MO node.

Alternatively,

the receiving module 121 is specifically configured to receive a DMmodification command sent by the device management server, where the DMmodification command acts on the fifth MO node and the fifth MO node isspecifically configured to modify a topology connection relationshipbetween a specified device and a neighbor device; and the managementmodule 122 is specifically configured to permit a specified neighbordevice to admit a new child device and prohibit other neighbor devicesfrom admitting the child device, instruct the specified device to rejoinin the network, and update the topology connection relationship amongthe sensor devices in the second MO node.

Alternatively,

the receiving module 121 is specifically configured to receive a DMmodification command sent by the device management server, where the DMmodification command acts on the sixth MO node; and the managementmodule 122 is specifically configured to modify related serviceinformation of a specified sensor network device, including: modifying agroup and/or binding relationship of a specified service and updateinformation about a service provided by a specified sensor device in thethird MO node.

Alternatively,

the receiving module 121 is specifically configured to receive a DM getcommand sent by the device management server, where the DM get commandacts on the first MO node. The management module 122 is specificallyconfigured to send the overall information of the sensor network storedin the first MO node to the device management server.

Alternatively,

the receiving module 121 is specifically configured to receive a DM getcommand sent by the device management server, where the DM get commandacts on the second MO node; and the management module 122 isspecifically configured to send the characteristic information of eachsensor device and/or the information of the topology connectionrelationship among the sensor devices stored in the second MO node tothe device management server.

Alternatively,

the receiving module 121 is specifically configured to receive a DM getcommand sent by the device management server, where the DM get commandacts on the third MO node; and the management module 122 is specificallyconfigured to send the information about a service provided by eachsensor device stored in the third MO node to the device managementserver.

In this embodiment, a DM command is received through information of apreconstructed topology and a uniform management interface (that is, aDM protocol interface) consistent with existing remote device managementtechnologies is used, so that an M2M service platform (or other devicemanagement servers) can perform remote topology management andmaintenance not only on the M2M gateway, but also on a sensor networksuccessive to the M2M gateway, thereby reducing the complexity ofimplementing the management.

It may be understood that, related features in the method and device maybe referenced mutually. In addition, “first” and “second” in thepreceding embodiments are configured to distinguish embodiments, but donot represent superiority or inferiority of all embodiments.

Persons of ordinary skill in the art should understand that all or partof the steps of the method specified in any embodiment of the presentinvention may be implemented by a program instructing relevant hardware.The program may be stored in a computer readable storage medium. Whenthe program is run, the program executes the steps of the methodspecified in any embodiment above. The storage medium may be any mediumcapable of storing program codes, such as ROM, RAM, magnetic disk, oroptical disk.

Finally, it should be noted that the above embodiments of the presentinvention are merely intended for describing the technical solutions ofthe present invention other than limiting the present invention.Although the present invention is described in detail with reference tothe foregoing embodiments, persons of ordinary skill in the art shouldunderstand that they can still make modifications to the technicalsolution described in the foregoing embodiments or make equivalentsubstitutions to some technical features thereof, without departing fromthe spirit and scope of the technical solution of the embodiments of thepresent invention.

What is claimed is:
 1. A Machine to Machine (M2M) gateway, comprising: areceiver configured to receive a device management (DM) command from aDM server, with the DM server connecting to a plurality of sensordevices within a sensor network via the M2M gateway and with the DMcommand configured for remotely managing a sensor network topology; amemory storing a topology tree and instructions, the topology treecomprises a first management object (MO) node and a plurality of secondMO nodes, wherein the first MO node comprises an identification and atype of the sensor network, and each second MO node describes acharacteristic of a sensor device, neighbor devices of the sensor devicedescribed by the each second MO node, and a connection relationshipbetween the sensor device described by the each second MO node and theneighbor sensor devices, wherein the topology tree corresponds to thesensor network topology; a processor coupled to the receiver and thememory and executing the instructions, wherein the instructionsconfigure the M2M gateway to: receive the DM command; based on addressinformation of a specified second MO node specified within the DMcommand, retrieve the characteristic of each of the plurality of sensordevices and the connection relationship of the plurality of sensordevices from a corresponding second MO node of the topology tree; and atransmitter configured to send the characteristic of each of theplurality of sensor devices and the connection relationship of theplurality of sensor devices of the sensor network to the DM server. 2.The M2M gateway according to claim 1, further comprising a third MO nodeand a fourth MO node, wherein the third MO node and the fourth MO nodeare configured to discover at least one of a topology connectionrelationship among the sensor devices or information about a serviceprovided by each sensor device.
 3. The M2M gateway according to claim 1,further comprising at least one of a fifth MO node configured to modifya topology connection relationship among the sensor devices or a sixthMO node configured to modify information about a service provided by thesensor device.
 4. The M2M gateway according to claim 2, wherein thefourth MO node further comprises a child MO node configured to instructreporting of a subsequent topology change, based on an address withinthe DM command and information within a child MO node of the fourth MOnode.
 5. The M2M gateway according to claim 2, wherein: the receiver isconfigured to receive a DM modification command sent by the DM server,wherein the DM modification command comprises an address of the fifth MOnode, and the fifth MO node is configured to remove a device specifiedby the fifth MO node from the sensor network; the transmitter isconfigured to send a removal command to the specified device; and theprocessor is configured to update at least one of the characteristicinformation of each sensor device, the topology connection relationshipamong the sensor devices in the second MO node, or the information abouta service provided by each sensor device in the third MO node.
 6. TheM2M gateway according to claim 2, wherein: the receiver is configured toreceive a DM modification command sent by the DM server, wherein the DMmodification command comprises an address of the fifth MO node and thefifth MO node is configured to remove a device specified by the fifth MOnode and a child device of the specified device from the sensor network;the transmitter is configured to send a removal command to the specifieddevice, wherein the removal command comprises indication information ofremoving the child device; and the processor is configured to update atleast one of the characteristic information of each sensor device, thetopology connection relationship among the sensor devices in the secondMO node, or the information about a service provided by each sensordevice in the third MO node.
 7. The M2M gateway according to claim 2,wherein: the receiver is configured to receive a DM modification commandsent by the DM server, wherein the DM modification command comprises anaddress of the fifth MO node and the fifth MO node is configured to adda device specified by the fifth MO node into the sensor network; thetransmitter is configured to send a connection establishment requestmessage to the specified device; and the processor is configured toupdate at least one of the characteristic information of each sensordevice, the topology connection relationship among the sensor devices inthe second MO node, or the information about a service provided by eachsensor device in the third MO node.
 8. The M2M gateway according toclaim 3, wherein: the receiver is configured to receive a DMmodification command sent by the DM server, wherein the DM modificationcommand comprises an address of the fifth MO node and the fifth MO nodeis configured to modify a topology connection relationship between adevice specified by the fifth MO node and a neighbor device; theprocessor is configured to permit a neighbor device to admit a new childdevice and prohibit other neighbor devices from admitting a childdevice, instruct the specified device to rejoin the network, and updatethe topology connection relationship among the sensor devices in thesecond MO node.
 9. A network system, comprising: a device management(DM) server configured to send a DM command for managing a sensornetwork topology; and a Machine to Machine (M2M) gateway coupled to theDM server and adapted to couple to a plurality of sensor devices in asensor network, the M2M gateway being configured to: store a topologytree that includes first management object (MO) node and a plurality ofsecond MO nodes, wherein the first MO node includes an identificationand a type of the sensor network, and each second MO node describes acharacteristic of a sensor device, neighbor devices of the sensor devicedescribed by the each second MO node, and a connection relationshipbetween the sensor device described by the each second MO node and theneighbor sensor devices, wherein the topology tree corresponds to thesensor network topology; after receiving the DM command and according toaddress information of a specified second MO node specified within theDM command, retrieve the characteristic of each of the plurality ofsensor devices and the connection relationship of the plurality ofsensor devices from a corresponding second MO node; and send thecharacteristic of each of the plurality of sensor devices and theconnection relationship of the plurality of sensor devices of the sensornetwork to the DM server.
 10. The network system according to claim 9,further comprising a third MO node and a fourth MO node, wherein thethird MO node and the fourth MO node are configured to discover at leastone of a topology connection relationship among the sensor devices orinformation about a service provided by each sensor device.
 11. Thenetwork system according to claim 10, further comprising at least one ofa fifth MO node configured to modify the connection relationship amongthe sensor devices or a sixth MO node configured to modify informationabout a service provided by the sensor device.
 12. The network systemaccording to claim 10, wherein the fourth MO node further comprises achild MO node configured to instruct reporting of a subsequent topologychange based on an address within the DM command and information withina child MO node of the fourth MO node.
 13. The network system accordingto claim 11, wherein the M2M gateway is further configured to: receive aDM modification command sent by the DM server, wherein the DMmodification command comprises an address of the fifth MO node and thefifth MO node is configured to remove a device specified by the fifth MOnode from the sensor network; send a removal command to the specifieddevice; and update at least one of the characteristic information ofeach sensor device, the topology connection relationship among thesensor devices in the second MO node, or the information about a serviceprovided by each sensor device in the third MO node.
 14. The networksystem according to claim 11, wherein the M2M gateway is furtherconfigured to: receive a DM modification command sent by the DM server,wherein the DM modification command comprises an address of the fifth MOnode and the fifth MO node is configured to remove a device specified bythe fifth MO node and a child device of the specified device from thesensor network; send a removal command to the specified device, whereinthe removal command comprises indication information of removing thechild device; and update at least one of the characteristic informationof each sensor device, the topology connection relationship among thesensor devices in the second MO node, or the information about a serviceprovided by each sensor device in the third MO node.
 15. The networksystem according to claim 11, wherein the M2M gateway is furtherconfigured to: receive a DM modification command sent by the DM server,wherein the DM modification command comprises an address of the fifth MOnode and the fifth MO node is configured to add a device specified bythe fifth MO node into the sensor network; send a connectionestablishment request message to the specified device; and update atleast one of the characteristic information of each sensor device, thetopology connection relationship among the sensor devices in the secondMO node, or the information about a service provided by each sensordevice in the third MO node.
 16. The network system according to claim11, wherein the M2M gateway is further configured to: receive a DMmodification command sent by the DM server, wherein the DM modificationcommand comprises an address of the fifth MO node and the fifth MO nodeis configured to modify a topology connection relationship between adevice specified by the fifth MO node and a neighbor device; and permita neighbor device to admit a new child device and prohibit otherneighbor devices from admitting a child device, and instruct thespecified device to rejoin the network, and update the topologyconnection relationship among the sensor devices in the second MO node.17. A method for remotely managing a sensor network topology,comprising: receiving, by a Machine to Machine (M2M) gateway, a devicemanagement (DM) command for remotely managing a sensor network topologyfrom a DM server that connects to a plurality of sensor devices within asensor network via the M2M gateway, wherein the M2M gateway stores atopology tree comprising a first management object (MO) node and aplurality of second MO nodes, wherein the first MO node comprises anidentification and a type of the sensor network and each second MO nodedescribes a characteristic of a sensor device, neighbor devices of thesensor device described by the each second MO node, and a connectionrelationship between the sensor device described by the each second MOnode and the neighbor sensor devices, wherein the topology treecorresponds to the sensor network topology; after receiving the DMcommand and based on address information of a specified second MO nodespecified within the DM command, retrieving, by the M2M gateway,characteristics of each of the plurality of sensor devices and aconnection relationship of the plurality of sensor devices from acorresponding second MO node in the topology tree; and sending, by theM2M gateway, the characteristics of each of the plurality of sensordevices and the connection relationship of the plurality of sensordevices of the sensor network to the DM server.